home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / doc.zoo / doc / usrman / doc.1 < prev    next >
Encoding:
Text File  |  1989-01-24  |  25.4 KB  |  976 lines

  1. '\"                        Copyright (c) 1988 Bellcore
  2. '\"                            All Rights Reserved
  3. '\"       Permission is granted to copy or use this program, EXCEPT that it
  4. '\"       may not be sold for profit, the copyright notice must be reproduced
  5. '\"       on copies, and credit should be given to Bellcore where it is due.
  6. '\"       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7. '\"
  8. '\"    $Header: doc.1,v 4.2 88/06/30 12:44:53 bianchi Exp $
  9. '\"    $Source: /tmp/mgrsrc/doc/usrman/RCS/doc.1,v $
  10. .TL
  11. \*M - C Language Application Interface
  12. .AU
  13. Stephen A. Uhler
  14. .AI
  15. Bell Communications Research
  16. .Sh nopage Introduction
  17. .FS
  18. .ce 2
  19. Copyright (c) 1988 Bellcore
  20. All Rights Reserved
  21. .br
  22. Permission is granted to copy or use this program, EXCEPT that it
  23. may not be sold for profit, the copyright notice must be reproduced
  24. on copies, and credit should be given to Bellcore where it is due.
  25. BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  26. .FE
  27. \*M 
  28. (\fBm\fPana\fBg\fPe\fBr\fP)
  29. is a window system for Unix that currently runs on Sun Workstations.
  30. \*M manages asynchronous updates of overlapping windows
  31. and provides application support for a heterogeneous network
  32. environment, i.e.,
  33. many different types of computers connected by various 
  34. communications media.
  35. The application interface enables applications (called client programs) to be
  36. written in a variety of programming languages, and run on different
  37. operating systems.
  38. The client program can take full 
  39. advantage of the windowing capabilities 
  40. regardless of the
  41. type of connection to the workstation running \*M.
  42. .LP
  43. Client programs communicate with \*M via
  44. .I pseudo-terminals 
  45. over a reliable byte stream.
  46. Each client program can create and manipulate one or more windows
  47. on the display, with commands and data to the various windows multiplexed over 
  48. the same connection.
  49. \*M provides
  50. .SM
  51. ASCII
  52. .LG
  53. terminal emulation and takes responsibility for
  54. maintaining the integrity of the window contents when parts of windows become 
  55. obscured and subsequently uncovered.
  56. This permits naive applications to work without modification
  57. by providing a default environment that appears to be an ordinary terminal.
  58. .LP
  59. In addition to terminal emulation, \*M provides each client window with:
  60. graphics primitives such as line and circle drawing; facilities for 
  61. manipulating bitmaps, fonts, icons, and pop-up menus;
  62. commands to reshape
  63. and position windows; and a message passing
  64. facility enabling client programs
  65. to rendezvous and exchange messages.
  66. Client programs may ask to be informed when a change in the window system
  67. occurs, such as a reshaped window, a pushed mouse button,
  68. or a message sent from another client program.
  69. These changes are called events.
  70. \*M notifies a client program of an event by sending
  71. it an
  72. .SM
  73. ASCII
  74. .LG
  75. character string in a format specified by the client program.
  76. Existing applications can be integrated into the
  77. windowing environment without modification by having \*M
  78. imitate keystrokes in response to user defined menus or
  79. other events.
  80. .LP
  81. The user interface provides a simple point-and-select model of 
  82. interaction using the mouse with pop-up menus and
  83. quick access to system functions through meta-keys on the keyboard.
  84. \*M also provides a 
  85. .I cut
  86. and
  87. .I  paste
  88. .R
  89. function that permits a user to sweep out and copy text from any window
  90. and paste it into any other.
  91. .LP
  92. This document describes the low level 
  93. C interface library for \*M.
  94. The 
  95. .I
  96. C Interface library
  97. .R
  98. provides a set of macros and functions which implement the stream protocol
  99. and provide clients written in
  100. .B C
  101. with a function call interface to \*M.
  102. This library provides the lowest level access to \*M functions
  103. and represents a direct mapping to the underlying protocol.
  104. It is expected that a higher level interface will evolve to support
  105. application development at a higher level.
  106. The library requires only the
  107. .SM
  108. UNIX
  109. .LG
  110. .I "Standard I/O Library"
  111. for its operation and access to a byte sequential I/O
  112. interface from the underlying operating system.
  113. .Sh page Model of Interaction
  114. The basic unit within \*M is the window.
  115. A window is a rectangular region on the display, surrounded by a
  116. border, with a single connection to other processes.
  117. All interactions among the client program, the user and \*M are
  118. defined entirely in terms of the state
  119. of a client's window or windows.
  120. \*M has no concept of window types; there are no separate
  121. .I "graphics windows" ,
  122. .I "text windows" ,
  123. or
  124. .I "edit windows" .
  125. Every window supports exactly the same set of capabilities as
  126. every other window.
  127. In addition, all windows act independently.
  128. Client programs need not know or care about the existence of other
  129. clients or windows that happen to coexist on the same display.
  130. The management of overlapping windows is handled entirely by \*M.
  131. For example,
  132. when a window is partially or totally obscured by another window,
  133. then subsequently uncovered, \*M restores the integrity of the
  134. window's contents.
  135. There are no
  136. .I sub-windows ,
  137. windows whose size or position are in some
  138. way restricted by a parent window.
  139. A client may create and manipulate many windows, each of which
  140. may be positioned and sized independently on the display.
  141. .LP
  142. At any given time there is one special window on the display,
  143. the
  144. .I active
  145. window.
  146. This is the window that receives keystrokes and mouse data.
  147. It is distinguishable to the user from the other windows on the
  148. display by its emboldened border.
  149. The active window, in addition to receiving all mouse and keyboard
  150. data, is also logically in front of the other windows
  151. on the display.
  152. The active window is, therefore, always completely exposed.
  153. Any window can become the active window, but there can only be one 
  154. active window at a time.
  155. .LP
  156. A client program may change its window at any time, write text into it,
  157. draw lines, anything, so long as the change is
  158. .I local ,
  159. that is the change affects just its window.
  160. Only the active window may effect 
  161. .I global
  162. changes
  163. to the display,
  164. such as changing its shape or position.
  165. The only global action a
  166. .I non-active
  167. window may perform is to become the active window.
  168. This window model provides both the user and
  169. application developer with a simple,
  170. consistent model of interaction.
  171. .Sh nopage Coordinate Systems
  172. \*M uses four different coordinate systems,
  173. .I display
  174. coordinates ,
  175. .I "absolute window"
  176. coordinates,
  177. .I "relative window"
  178. coordinates,
  179. and
  180. .I character
  181. coordinates.
  182. The entire display is represented by
  183. .I "display coordinates"
  184. whereas each window has its own
  185. .I "absolute window" ,
  186. .I "relative window" ,
  187. and
  188. .I character
  189. coordinate systems.
  190. .LP  
  191. .I "Display coordinates"
  192. are in units of pixels.
  193. The coordinate
  194. .Fr "" 0 0
  195. is the top left
  196. pixel on the display.  The
  197. .B X
  198. coordinate increases to the right, the
  199. .B Y
  200. coordinate
  201. increases down.
  202. The maximum
  203. .B X
  204. and
  205. .B Y
  206. coordinate depend upon the particular display in use,
  207. for the SUN-3 they are
  208. .Fi 1152
  209. by
  210. .Fi 900 .
  211. Commands that operate on the context of the entire display, such as
  212. reshaping a window are specified in 
  213. .I display
  214. coordinates.
  215. Windows, when measured
  216. in
  217. .I display
  218. coordinates include their borders.
  219. .LP
  220. .I "Absolute window coordinates" ,
  221. as with
  222. .I "display coordinates" ,
  223. are measured in units of pixels.
  224. The
  225. .Fi X
  226. and
  227. .Fi Y
  228. values increase to the right and down respectively.
  229. The origin, coordinate
  230. .Fr "" 0 0
  231. is at the top left corner of the window, just inside the window border.
  232. .LP
  233. .I "Relative window coordinates"
  234. are measured as a fraction of the window's size and shape.
  235. As with
  236. .I "absolute window coordinates" ,
  237. each window has its origin, 
  238. .Fr "" 0 0
  239. , at the top left corner of the window just inside the border,
  240. however the lower right corner of the window is always at 
  241. coordinate
  242. .Fr "" 999 999
  243. \&.
  244. Graphics commands to a window in 
  245. .I "relative window coordinates"
  246. are automatically scaled to the size of the window.
  247. .LP
  248. .I "Character coordinates"
  249. are measured in rows and columns in the current
  250. font, just like an ordinary terminal.
  251. The coordinate
  252. .Fr "" 0 0 
  253. is the top left character
  254. position in the window.
  255. The maximum
  256. .I row
  257. and
  258. .I column
  259. in the window
  260. depends on both the window and font size.
  261. .Sh nopage Functional Overview
  262. The types of commands a client program may issue \*M
  263. are divided into 14
  264. categories:
  265. .I "terminal emulation" ,
  266. .I graphics ,
  267. .I bit-blts ,
  268. .I "window positioning" ,
  269. .I "font changes" ,
  270. .I "state inquiry" ,
  271. .I "saved contexts" ,
  272. .I menus ,
  273. .I events ,
  274. .I "sweep functions" ,
  275. .I "multiple window manipulation" ,
  276. .I "cut and paste" ,
  277. .I messages ,
  278. and
  279. .I "window modes" .
  280. What follows is a brief description of those command categories,
  281. and some examples of specific functions within the category.
  282. A detailed description of each command is provided in the following
  283. section.
  284. .LP
  285. .B
  286. Terminal Emulation
  287. .R
  288. .br
  289. At its basic level, every \*M window emulates a
  290. .I \s-2CRT\s+2
  291. terminal.
  292. It provides functions for
  293. .I inserting
  294. and
  295. .I deleting
  296. lines and characters, highlighting text, clearing areas and windows, and
  297. arbitrary cursor motion capabilities.
  298. Sample \*M 
  299. .I \s-2TERMCAP\s+2
  300. and
  301. .I \s-2TERMINFO\s+2
  302. descriptions are given in the tables below.
  303. No entries are provided for keyboard key values,
  304. as they depend upon the particular keyboard in use.
  305. .Mk    \" mark vertical baseline or later return
  306. .TS
  307. box;
  308. c s
  309. l s
  310. l lflrp-2.
  311. Sample \*M \fIT\s-2ERMCAP\fP\s+2 Entry
  312. _
  313. Px \(vr \*M \(vr \*M terminal:\e
  314.   :am:bs:im=:ta=^I:\e
  315.   :AL=\eE%da:al=\eEa:\e
  316.   :cd=\eEC:ce=\eEc:cl=^L:\e
  317.   :cm=\eE%r%d,%dM:\e
  318.   :co#80:li#24:\e
  319.   :cs=\eE%d,%dt:\e
  320.   :DC=\eE%dE:dc=\eEE:\e
  321.   :DL=\eE%dd:dl=\eEd:\e
  322.   :do=\eEf:up=\eEu:nd=\eEr:\e
  323.   :IC=\eE%dA:ic=\eEA:\e
  324.   :se=\eEn:so=\eEi:\e
  325.   :ve=\eEv:vs=\eEV:
  326. .TE
  327. .Go 3.1i    \" return to baseline shifted right
  328. .TS
  329. box;
  330. c s
  331. l s
  332. l lflrp-2.
  333. Sample \*M \fIT\s-2ERMINFO\s+2\fP Entry
  334. _
  335. Px \(br \*M \(br \*M Terminal,
  336.   cols#80, lines#24,
  337.   am, msgr, ht=^I,
  338.   clear=^L, cr=^M, bel=^G, 
  339.   cub1=^H, cud1=\eEf, cuf1=\eEr,
  340.   cuu1=\eEu, ind=^J,
  341.   cup=\eE%p2%d;%p1%dM,
  342.   csr=\eE%p1%d;%p2%dt,
  343.   wind=\eE%p2%d;%p2%p4%+%d;%p1;%p1%p3%+%d;t,
  344.   el=\eEc, ed=\eEC,
  345.   il1=\eEa, dl1=\eEd,
  346.   il=\eE%p1%da, dl=\eE%p1%dd,
  347.   smso=\eEi, rmso=\eEn,
  348.   smcup=\eE1664P, rmcup=\eEt\eEp,
  349. .TE
  350. .Rs    \" restore baseline stuff
  351. .LP
  352. \*M permits the client program to restrict the terminal emulator
  353. to an arbitrary subrectangle within the window,
  354. called a
  355. .I "text region" .
  356. For example, a text editor wishing to provide scroll bars or banner lines
  357. can still let \*M do the terminal emulation by specifying a text
  358. region that excludes the top and sides of the window.
  359. This text region may be redefined or moved around at will, permitting
  360. multiple terminal sub regions in the same window.
  361. .LP
  362. .B Graphics
  363. .br
  364. In addition to terminal emulation, \*M provides a suite of pen plotter style
  365. graphics primitives.
  366. A client program may draw lines, circles, ellipses, and elliptical arcs
  367. on a window.
  368. The graphics objects may either be completely positioned, or located 
  369. relative to an internal
  370. .I "graphics point" ,
  371. maintained by \*M.
  372. The objects may also be drawn into undisplayed or
  373. .I scratchpad
  374. areas, then copied to the window as a single unit.
  375. The
  376. .I "graphics point"
  377. may be aligned with the character cursor,
  378. for locating graphic objects relative to character text.
  379. Conversely, the character cursor may be aligned with the graphics cursor, 
  380. permitting character text to be placed at arbitrary positions on the window.
  381. .LP
  382. .B Bit-blts
  383. .br
  384. \*M provides a complete set of functions for dealing with bitmaps, or
  385. rectangular arrays of pixels.
  386. Bitmaps may be combined with any of the 16 possible
  387. .I bit-blt
  388. operations.
  389. Non-displayed
  390. bitmaps of arbitrary size may be created and destroyed, and
  391. .I bit-blts
  392. may be performed on the window, within a scratch-pad bitmap,
  393. between two scratch-pad  bitmaps,
  394. or between a scratch-pad bitmap and the window.
  395. Bitmap images may be down-loaded from client programs to \*M, 
  396. or up-loaded from \*M to the client program.
  397. In addition, bitmaps may be saved in files by \*M, or loaded 
  398. into \*M from files.
  399. These last two capabilities permit client programs to manipulate large
  400. amounts of bitmap data without the need to send the bits
  401. over the communication channel.
  402. .LP
  403. .B "Window Positioning"
  404. .br
  405. Either the user or client program may move the 
  406. .I active
  407. window
  408. around on the display.
  409. Windows may be moved with their size retained, reshaped but remain at the
  410. same location, or be both moved and shaped anywhere on the display.
  411. If the window is the 
  412. .I active
  413. window,
  414. it may be
  415. .I buried
  416. (shoved to the back on the display).
  417. If the window is not the
  418. .I active
  419. window,
  420. it can become the active window and then moved about on the display.
  421. .LP
  422. .B "Font Changes"
  423. .br
  424. Client programs may change character fonts at any time, even on a
  425. character by character basis.
  426. \*M comes with scores of different fonts, 
  427. ranging in size from microscopic to viewgraph size.
  428. Client programs are
  429. free to create and down-load their own fonts.
  430. The fonts supplied by \*M are constant width, that is
  431. .I i 's
  432. take up the same amount of room as
  433. .I m 's
  434. do.  There are commands to aid client programs that wish to use 
  435. proportional fonts.
  436. .LP
  437. .B "State Inquiry"
  438. .br
  439. A client program may ask \*M about the state of its current window,
  440. such as its size and position on the display,
  441. the name and size of the current font,
  442. the position and extent of the text region, and the state of
  443. various mode settings.
  444. The client may also inquire about the state of the window system as a whole.
  445. That includes the position and state of the mouse, the number and sizes
  446. of the available fonts, and
  447. the organization of windows on the display.
  448. The display organization may include the position, size, name,
  449. ownership, and spatial ordering for all windows on the display.
  450. .LP
  451. .B "Saved Contexts"
  452. .br
  453. Certain parts of the current window environment may be pushed on a stack,
  454. then restored at some later time.
  455. Client programs rarely need to know the context in which they are called.
  456. They simply push those aspects of the environment they will change, then
  457. restore them before exiting.
  458. About a dozen different parts of the window environment, such as menus,
  459. character fonts, window position, etc. may be stacked independently, or in
  460. any combination.
  461. .LP
  462. .B Menus
  463. .br
  464. \*M has built in support for pop-up menus.
  465. Clients may arrange for menus to pop-up in response to mouse button
  466. hits.
  467. Up to 50 menus may be down-loaded at once for each window.
  468. The client
  469. .I selects
  470. which menu will pop-up when a mouse button is pushed.
  471. When an item of a pop-up menu is chosen, \*M returns the string
  472. previously put into the menu by the client program.
  473. The client program may arrange
  474. for different menus to pop up depending upon the
  475. current mouse position.
  476. Menus may also be linked together as a pop-up menu tree.
  477. Sliding off to the right of a menu (called a
  478. .I parent
  479. menu) while an item is selected
  480. can cause another menu (called a
  481. .I child
  482. menu)
  483. to pop up.
  484. Any item of the
  485. .I parent
  486. menu may be specified as the entry item for a child menu.
  487. Upon selecting an item of a
  488. .I child
  489. menu,
  490. the client program may arrange for \*M to return
  491. ether the action string associated with just the
  492. .I child
  493. menu item,
  494. or the action strings for the selected items of all the menus.
  495. Similar to 
  496. .I sliding
  497. menus,
  498. \*M supports 
  499. .I paging
  500. menus as well.
  501. Long menus may be broken into several pages by the client program.
  502. \*M manages the paging automatically, popping up the next page as
  503. the user slides off the bottom of a paged menu.
  504. .LP
  505. .B Events
  506. .br
  507. Client programs may arrange to be informed by \*M when some change,
  508. called an event,
  509. happens to the state of the window system.
  510. As with menus, the message informing the client program of a change
  511. is formated as specified by the client program.
  512. Examples of events include mouse buttons being depressed or released,
  513. windows changing shape or moving, and the window becoming the
  514. .I active
  515. window or being covered by another window.
  516. Window state information, such as the current cursor position,
  517. may be returned as part of an event string.
  518. .LP
  519. .B "Sweep Functions"
  520. .br
  521. It is often convenient for client programs to
  522. .I sweep ,
  523. or
  524. .I rubber-band
  525. simple objects, such as lines or boxes, in response to moving the mouse.
  526. \*M provides client programs with a mouse activated sweep function.
  527. \*M tracks an edge of the line or box with the mouse and reports 
  528. the coordinates to the client at the conclusion of the sweep
  529. operation, when the user releases the mouse.
  530. As usual, the client program specifies the format of the data returned by
  531. \*M.
  532. .LP
  533. .B "Multiple Window Manipulation"
  534. .br
  535. A single client program may create and manipulate additional windows, called
  536. .I alternate
  537. windows.
  538. The data destined for, or to be received from, an
  539. .I alternate 
  540. window is multiplexed on the same channel as the main window.
  541. The client program selects a window to receive output, and all output
  542. goes to the selected window until a different window is selected.
  543. For input, the client program uses the
  544. .I event
  545. mechanism to determine from which window input arrived.
  546. Alternate windows have the same capabilities as the main window.
  547. There is currently no limit to the number of alternate windows a
  548. client program may have.
  549. Up to 100 windows may exist on the display at one time
  550. before performance begins to degrade seriously.
  551. .LP
  552. .B "Cut and Paste"
  553. .br
  554. \*M provides a globally accessible 
  555. .I snarf
  556. buffer shared among all client programs.
  557. Any client program
  558. may put data into or read data from this buffer.
  559. \*M provides a user initiated 
  560. .I cut
  561. and
  562. .I paste
  563. function from the command menu.
  564. \*M extracts character text from the window and places its
  565. \s-2ASCII\s+2
  566. representation into the 
  567. .I snarf 
  568. buffer.
  569. .I Paste
  570. copies the contents of the
  571. .I snarf 
  572. buffer to the input stream of the active
  573. window.
  574. Client programs, by manipulating the data in the 
  575. .I snarf
  576. buffer,
  577. can interact with the system
  578. .I cut
  579. and
  580. .I paste
  581. functions.
  582. .LP
  583. .B Messages
  584. .br
  585. Although the 
  586. .I snarf
  587. buffer gives client programs a simple asynchronous interprocess
  588. communication mechanism, \*M has a more general synchronous interprocess
  589. message passing scheme.
  590. A client program may send a message
  591. to another client program, or broadcast the message to all client programs.
  592. As a message recipient, the client program may elect to receive messages
  593. as an
  594. .I event
  595. and encapsulate the message and sender name in the format of its choice.
  596. \*M provides the primitives needed to implement 
  597. .I server
  598. clients
  599. by permitting 
  600. .I servers
  601. to register their names, services and protocols with \*M.
  602. Client
  603. programs may query \*M for a list of active
  604. .I servers .
  605. .I Server
  606. messages may be associated with windows by the
  607. .I server
  608. client programs in such a way that the message is automatically
  609. received by a client
  610. program as part of a 
  611. .I "mouse button"
  612. event whenever the mouse button is 
  613. pressed on the
  614. .I server 's
  615. window.
  616. Using this mechanism, client programs can interact with
  617. .I server
  618. clients without any advance knowledge of which 
  619. .I server s
  620. are available or what services they are providing.
  621. .br
  622. .LP
  623. .B "Window Modes"
  624. .br
  625. Client programs may select various combinations of window modes.
  626. These modes tailor the behavior of the macros described above.
  627. Examples of window modes include
  628. .I "auto line wrap"
  629. and
  630. .I "character overstrike"
  631. that affect the terminal emulation,
  632. different coordinate system settings that affect
  633. .I graphics
  634. commands, or
  635. flags that set a window to
  636. .I activate 
  637. automatically upon receiving input, 
  638. ignore all keyboard input, 
  639. or suspend output while a window is obscured.
  640. .Sh nopage Underlying Protocol
  641. The purpose of this library package is both to provide a function call
  642. interface to the stream protocol, and to document each command understood
  643. by \*M.
  644. There are two types of \*M commands, as summarized in the table below.
  645. .TS
  646. center box;
  647. c
  648. l.
  649. \*M command protocol
  650. _
  651. T{
  652. .B ESC
  653. .Sb X 1 ,
  654. .Sb X 2 , ... ,
  655. .Sb X n
  656. .B command
  657. T}
  658. T{
  659. .B ESC
  660. .Sb X 1 ,
  661. .Sb X 2 , ... ,
  662. .Sb X n
  663. .I length
  664. .B command
  665. .I data
  666. T}
  667. .sp 0.5v
  668. .TE
  669. In both cases, 
  670. .SM
  671. .B ESC
  672. .LG
  673. is the
  674. .SM
  675. ASCII
  676. .LG
  677. escape character or '\e033',
  678. whereas the word
  679. .B command
  680. represents a single character command identifier.
  681. The 
  682. .I X 's
  683. are optional integers,  there can be as few as zero, as in the command
  684. .TS
  685. center box;
  686. c.
  687. \fBESC\fP\fIa\fP
  688. .TE
  689. which inserts a blank line in the window, or
  690. as many as eight, as would be used by the command
  691. .TS
  692. center box;
  693. c.
  694. \fBESC\fP0,0,50,100,10,20,3,2\fIb\fP
  695. .TE
  696. which is an example of a command to copy images between bitmaps.
  697. No spaces may be included between the
  698. .B ESC
  699. character and the command identifier character, but the argument
  700. separators may be either commas (,) or semicolons (;).
  701. .LP
  702. The function of the command is determined both
  703. by the command identifier character
  704. and
  705. .I n ,
  706. the number of numeric arguments preceding the command identifier character.
  707. All of the commands with the same command identifier character are closely
  708. related in function.
  709. For example, all the commands
  710. in the following table have the same command character,
  711. .B 'o' ,
  712. and all draw ellipses, but have different effects based upon the
  713. number of arguments.
  714. .TS
  715. center box;
  716. c s
  717. l|l.
  718. Commands that draw \fIellipses\fP
  719. _
  720. 1    \fBESC\fP100,200\fBo\fP
  721. 2    \fBESC\fP100,200,300,400\fBo\fP
  722. 3    \fBESC\fP100,200,300,400,2\fBo\fP
  723. .TE
  724. All of the ellipses have major and minor axis lengths of 
  725. .I 100
  726. and
  727. .I 200 
  728. units respectively.
  729. Command 1 draws the ellipse at the current graphics location.
  730. Command 2 draws the ellipse at the location specified by the
  731. third and forth arguments, at
  732. .Fr "" 300 400
  733. \&.
  734. Command 3 draws the ellipse into scratchpad bitmap number
  735. .I 2 .
  736. .LP
  737. The second form of \*M commands,
  738. which is a special case of the first form,
  739. is used for downloading data from the
  740. client program to \*M.
  741. The integer
  742. .I length
  743. specifies the number of bytes of data to be downloaded, and
  744. .I data
  745. are the
  746. .I length
  747. number of data values downloaded.
  748. An example of the second type of \*M command is
  749. .TS
  750. center box;
  751. c.
  752. \fBESC\fP11,7\fBb\fP\fII-moved\fP
  753. .TE
  754. which instructs \*M to send the client program the string
  755. .I "I-moved"
  756. any time the client's window is moved to a different location
  757. on the display.
  758. The
  759. .I 11
  760. refers to the number of the
  761. .I move
  762. event and the
  763. .I 7
  764. is the number of characters in the event string, which in this case is
  765. .I "I-moved" .
  766. .LP
  767. All of the command identifier characters are listed in
  768. .I "window.h" .
  769. The command actions, determined by the command identifier and number
  770. of command arguments, are described by the macros in this document.
  771. .Sh page Conventions and Notation
  772. All functions and macros and programming examples are shown
  773. .ft \*(Ff
  774. in a typewriter font
  775. .ft
  776. to distinguish them from ordinary text.
  777. Similarly, function and macro arguments are shown in a 
  778. .ft \*(Fn
  779. bold typewriter font.
  780. .ft
  781. .LP
  782. The names of often used
  783. arguments passed to macros indicate their function,
  784. and are defined below.
  785. .Ad column , row
  786. The integers
  787. .Fa column
  788. and
  789. .Fa row
  790. refer to a character position in
  791. .I character
  792. coordinates even though characters may be placed at arbitrary pixel
  793. locations within a window
  794. and need not fall on
  795. .Fa column
  796. or
  797. .Fa row
  798. boundaries.
  799. .Ad Dwidth , Dheight
  800. The integers
  801. .Fa Dwidth
  802. and
  803. .Fa Dheight
  804. represent a width and height in
  805. .B display
  806. coordinates.
  807. .Ad mode
  808. The positive integer
  809. .Fa mode ,
  810. represents the bit combination 
  811. of window modes.
  812. .Fa Mode
  813. is usually an
  814. .I or ed
  815. list of constants in
  816. .I term.h .
  817. A typical use of
  818. .Fa mode
  819. is the argument to 
  820. .Fr m_push mode
  821.  as in
  822. .Fr m_push "P_FLAGS \(br P_EVENT \(br P_MENU"
  823. \&.
  824. .Ad n
  825. The small non-negative integer
  826. .Fi n
  827. represents a resource descriptor
  828. when describing objects such as windows, fonts, or menus.
  829. .Ad name
  830. .Fa Name
  831. is the file name of a bitmap image on the 
  832. .I \*M-host
  833. machine.
  834. File names given with no directory prefix are referenced relative to
  835. the
  836. .I icon
  837. subdirectory of
  838. \*M's 
  839. home directory.
  840. The home directory is installation dependent, and may be determined with
  841. the command
  842. .I "\*M -V" .
  843. .Ad parent , child
  844. The small positive integers
  845. .Fa parent
  846. and
  847. .Fa child
  848. represent menus.
  849. A
  850. .I child
  851. menu is linked
  852. to a
  853. .I parent 
  854. menu forming a tree of menus.
  855. .Ad radius
  856. The positive integer
  857. .Fa radius
  858. along with
  859. .Fa radius1
  860. and 
  861. .Fa radius2
  862. signifies a radius when referring to circles or 
  863. major and minor axis when referring to ellipses.
  864. They are only referenced in respect to
  865. .I window
  866. coordinates.
  867. .Ad string
  868. An array of characters,
  869. .Fi string
  870. is a null terminated
  871. .SM
  872. ASCII
  873. .LG
  874. character string.
  875. Except where noted, several
  876. .SM
  877. ASCII
  878. .LG
  879. control characters can be included in
  880. strings by escaping them with \e\fIX\fP, where
  881. .I X
  882. is one of the  characters shown in the following table.
  883. .TS
  884. center box;
  885. c s s
  886. c | c | c
  887. c | c | c
  888. r | l | l.
  889. Character string control characters
  890. _
  891. escape    octal    Meaning
  892. character    value    
  893. =
  894. \eb    010    Back space
  895. \eE    033    Escape
  896. \ee    033    Escape
  897. \ef    014    Form feed
  898. \eg    007    Bell
  899. \eM    *    Turn on 
  900.         8'th (parity) bit
  901. \en    012    New line
  902. \er    015    Return
  903. \es    040    Space
  904. \e\e    134    Back-slash (\e)
  905.  
  906. .TE
  907. .ce
  908. * \s-2(the next character has its 8'th bit turned on)\s+2
  909. .Ad to , from
  910. The small positive integers
  911. .Fa to
  912. and
  913. .Fa from
  914. identify the destination and source bitmaps for
  915. .I bit-blt
  916. operations.
  917. The value 0 (zero) represents the current window bitmap;
  918. positive integers name scratch-pad bitmap storage.
  919. .Ad width , height
  920. The integers
  921. .Fa width
  922. and
  923. .Fa height
  924. represent a width and height in
  925. .B window
  926. coordinates.
  927. .Ad X , Y
  928. The integer pair
  929. .Fr "" X Y
  930.  represents a point in 
  931. .I display
  932. coordinates.
  933. The suffixes
  934. .Fi src
  935. and
  936. .Fi dst
  937. as in
  938. .Fr "" X_src Y_src
  939.  or
  940. .Fr "" X_dst Y_dst
  941.  are used to indicate 
  942. .I source
  943. and 
  944. .I destination
  945. coordinates respectively.
  946. Similarly, the suffixes
  947. .Fi 1
  948. and
  949. .Fi 2
  950. as in
  951. .Fr "" X1 Y1
  952.  refer generically to the first or second coordinate.
  953. .Ad  x , y
  954. The integers
  955. .Fr "" x y
  956.  represent a point in
  957. .I window
  958. coordinates.  Whether that is
  959. .I relative
  960. (i.e. 0-999) or
  961. .I absolute
  962. depends upon the current coordinate setting of the window.
  963. As with
  964. .Fr "" X Y
  965.  above, the modifiers
  966. .Fi src , dst , 1 ,
  967. and
  968. .Fi 2
  969. refer respectively to the
  970. .I source ,
  971. .I destination ,
  972. .I first ,
  973. and
  974. .I second
  975. coordinates.
  976.